/*
 * @Author: 0x9DEFA478
 * @Date: 2021-08-08 16:39:20
 * @LastEditTime: 2022-01-08 23:02:36
 * @LastEditors: 0x9DEFA478
 * @Description: 
 * QQ:2652450237
 * ============================================================================================================================================
 * 
 * 
 * 
 *                                                                                               ************      ****************************
 *                                                                                             ************      ****************************  
 *                                                                                           ************      ****************************    
 *                                                                                         ************      ****************************      
 *                                                                                       ************      ************                        
 *                                                                                     ************      ************                          
 *                                                                                   ************      ************                            
 *                                                                                 ************      ************                              
 *                                                                               ************      ************                                
 *                                                                             ************      ************                                  
 *                                                                           ************      ************                                    
 *                                                                         ************      ************                                      
 *                                                                       ************      ************                                        
 *                                                                     ************      ************                                          
 *                                                                   ************      ************                                            
 *                                                                 ************      ************                                              
 *                                                               ************      ************                                                
 *                                                             ************      ************                                                  
 *                                                           ************      ************                                                    
 *                                                         ************      ************                                                      
 *                                                       ************      ************                                                        
 *                                                     ************      ************                                                          
 *                                                   ************      ************                                                            
 *                                                 ************      ************                                                              
 *                                               ************      ************                                                                
 *                                             ************      ************                                                                  
 *                                           ************      ************                                                                    
 *                                         ************      ************                                                                      
 *                                       ************      ************                                                                        
 *                                     ************      ************                                                                          
 *                                   ************      ************                                                                            
 *                                 ************      ************                                                                              
 *                               ************      ************                                                                                
 *                             ************      ************                                                                                  
 *                           ************      ************                                                                                    
 *                         ************      ************                                                                                      
 *       ****************************      ************                                                                                        
 *     ****************************      ************                                                                                          
 *   ****************************      ************                                                                                            
 * ****************************      ************                                                                                              
 * 
 * 
 * 
 * ============================================================================================================================================
 * 
 */
#ifndef __H_USB_Desc_H_
#define __H_USB_Desc_H_


#define  vH_USB_DescType_Device                         0x01U
#define  vH_USB_DescType_Configuration                  0x02U
#define  vH_USB_DescType_String                         0x03U
#define  vH_USB_DescType_Interface                      0x04U
#define  vH_USB_DescType_Endpoint                       0x05U
#define  vH_USB_DescType_DeviceQualifier                0x06U
#define  vH_USB_DescType_OtherSpeedConfiguration        0x07U
#define  vH_USB_DescType_InterfaceAssociation           0x0BU
#define  vH_USB_DescType_BOS                            0x0FU



#define cLittleTo2Bytes(value)                          ((value)&0xFFU),(((value)>>8)&0xFFU)
#define cLittleTo4Bytes(value)                          ((value)&0xFFU),(((value)>>8)&0xFFU),(((value)>>16)&0xFFU),(((value)>>24)&0xFFU)


//============================================================================================================================================
//HID
//============================================================================================================================================

#define cHID_ReportMainItem_Input(Size)                            (0x80U|(Size&0x03U))
#define cHID_ReportMainItem_Output(Size)                           (0x90U|(Size&0x03U))
#define cHID_ReportMainItem_Feature(Size)                          (0xB0U|(Size&0x03U))
#define cHID_ReportMainItem_Collection(Size)                       (0xA0U|(Size&0x03U))
#define cHID_ReportMainItem_EndCollection(Size)                    (0xC0U|(Size&0x03U))

#define cHID_ReportGlobalItem_UsagePage(Size)                      (0x04U|(Size&0x03U))
#define cHID_ReportGlobalItem_LogicalMinimum(Size)                 (0x14U|(Size&0x03U))
#define cHID_ReportGlobalItem_LogicalMaximum(Size)                 (0x24U|(Size&0x03U))
#define cHID_ReportGlobalItem_PhysicalMinimum(Size)                (0x34U|(Size&0x03U))
#define cHID_ReportGlobalItem_PhysicalMaximum(Size)                (0x44U|(Size&0x03U))
#define cHID_ReportGlobalItem_UnitExponent(Size)                   (0x54U|(Size&0x03U))
#define cHID_ReportGlobalItem_Unit(Size)                           (0x64U|(Size&0x03U))
#define cHID_ReportGlobalItem_ReportSize(Size)                     (0x74U|(Size&0x03U))
#define cHID_ReportGlobalItem_ReportID(Size)                       (0x84U|(Size&0x03U))
#define cHID_ReportGlobalItem_ReportCount(Size)                    (0x94U|(Size&0x03U))
#define cHID_ReportGlobalItem_Push(Size)                           (0xA4U|(Size&0x03U))
#define cHID_ReportGlobalItem_Pop(Size)                            (0xB4U|(Size&0x03U))

#define cHID_ReportLocalItem_Usage(Size)                           (0x08U|(Size&0x03U))
#define cHID_ReportLocalItem_UsageMinimum(Size)                    (0x18U|(Size&0x03U))
#define cHID_ReportLocalItem_UsageMaximum(Size)                    (0x28U|(Size&0x03U))
#define cHID_ReportLocalItem_DesignatorIndex(Size)                 (0x38U|(Size&0x03U))
#define cHID_ReportLocalItem_DesignatorMinimum(Size)               (0x48U|(Size&0x03U))
#define cHID_ReportLocalItem_DesignatorMaximum(Size)               (0x58U|(Size&0x03U))
#define cHID_ReportLocalItem_StringIndex(Size)                     (0x78U|(Size&0x03U))
#define cHID_ReportLocalItem_StringMinimum(Size)                   (0x88U|(Size&0x03U))
#define cHID_ReportLocalItem_StringMaximum(Size)                   (0x98U|(Size&0x03U))
#define cHID_ReportLocalItem_Delimiter(Size)                       (0xA8U|(Size&0x03U))

#define vHID_ReportItemValue_Collection_Physical                   0x00U
#define vHID_ReportItemValue_Collection_Application                0x01U
#define vHID_ReportItemValue_Collection_Logical                    0x02U
#define vHID_ReportItemValue_Collection_Report                     0x03U
#define vHID_ReportItemValue_Collection_NamedArray                 0x04U
#define vHID_ReportItemValue_Collection_UsageSwitch                0x05U
#define vHID_ReportItemValue_Collection_UsageModifier              0x06U

#define vH_USB_HIDRequest_GetReport                                0x01U
#define vH_USB_HIDRequest_GetIdle                                  0x02U
#define vH_USB_HIDRequest_GetProtocol                              0x03U
#define vH_USB_HIDRequest_SetReport                                0x09U
#define vH_USB_HIDRequest_SetIdle                                  0x0AU
#define vH_USB_HIDRequest_SetProtocol                              0x0BU


//============================================================================================================================================
//winusb
//============================================================================================================================================

#define MS_OS_20_SET_HEADER_DESCRIPTOR        0x00U
#define MS_OS_20_SUBSET_HEADER_CONFIGURATION  0x01U
#define MS_OS_20_SUBSET_HEADER_FUNCTION       0x02U
#define MS_OS_20_FEATURE_COMPATIBLE_ID        0x03U
#define MS_OS_20_FEATURE_REG_PROPERTY         0x04U
#define MS_OS_20_FEATURE_MIN_RESUME_TIME      0x05U
#define MS_OS_20_FEATURE_MODEL_ID             0x06U
#define MS_OS_20_FEATURE_CCGP_DEVICE          0x07U
#define MS_OS_20_FEATURE_VENDOR_REVISION      0x08U

#define MS_OS_20_REG_PROPERTY_PropertyDataType_RESERVED                 0x00U
#define MS_OS_20_REG_PROPERTY_PropertyDataType_REG_SZ                   0x01U
#define MS_OS_20_REG_PROPERTY_PropertyDataType_REG_EXPAND_SZ            0x02U
#define MS_OS_20_REG_PROPERTY_PropertyDataType_REG_BINARY               0x03U
#define MS_OS_20_REG_PROPERTY_PropertyDataType_REG_DWORD_LITTLE_ENDIAN  0x04U
#define MS_OS_20_REG_PROPERTY_PropertyDataType_REG_DWORD_BIG_ENDIAN     0x05U
#define MS_OS_20_REG_PROPERTY_PropertyDataType_REG_LINK                 0x06U
#define MS_OS_20_REG_PROPERTY_PropertyDataType_REG_MULTI_SZ             0x07U







#endif //__H_USB_Desc_H_
